package com.btm.easymetadata.server.entity.base;

public abstract class Pageable {

    // 默认第一页
    private int pageNumber = 1;

    // 默认一页20条
    private int pageSize = 20000;

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getOffset() {
        return pageSize * Math.max(0, pageNumber - 1);
    }
}
